package ms.utils;

import javax.swing.ImageIcon;

public class TreeNodeData {
	private String text;
	private ImageIcon icon;
	private Object data;
	
	public TreeNodeData(String text) {
		this.text = text;
	}
	
	public TreeNodeData(String text, Object data) {
		this.text = text;
		this.data = data;
	}
	
	public TreeNodeData(String text, Object data, ImageIcon icon) {
		this.text = text;
		this.data = data;
		this.icon = icon;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public ImageIcon getIcon() {
		return icon;
	}

	public void setIcon(ImageIcon icon) {
		this.icon = icon;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}
	
	@Override
	public String toString() {
		return text != null ? text : data != null ? data.toString() : null;
	}
	
}
